import request from '@/utils/request'

export default {
  getAllLocation() {
    return request({
      url: `/weddingadmin/location/getAll`,
      method: 'get'
    })
  },

  getLocationPageVo(current, limit) {
    return request({
      url: `/weddingadmin/location/getLocationPageVo/${current}/${limit}`,
      method: 'get',
    })
  },

  getLocationPageQueryVo(current, limit, locationQuery){
    return request({
        url: `/weddingadmin/location/getLocationPageQuery/${current}/${limit}`,
        method: 'post',
        data: locationQuery  //转化json传递
      })
  },

  deleteAllSelect(ids) {
    return request({
        url: `/weddingadmin/location/deleteAllSelect`,
        method: 'delete',
        data: ids
    })
  },

  getOneById(id) {
    return request({
        url: `/weddingadmin/location/getOneById/${id}`,
        method: 'get',
    })
  },
  
  deleteOneById(id) {
    return request({
        url: `/weddingadmin/location/deleteOneById/${id}`,
        method: 'delete',
    })
  },

  searchByName(locationName) {
    return request({
        url: `/weddingadmin/location/searchByName/${locationName}`,
        method: 'get',
    })
  },

  saveOrUpdate(location) {
    return request({
        url: `/weddingadmin/location/saveOrUpdate`,
        method: 'post',
        data: location,
    })
  },
}
